<template>
    <view>
        <view class="choujiangs">
            <view class="zixun-item u-flex u-flex-col u-row-left u-col-top u-p-20 u-m-t-20" @click="jumpto(option)">
                <view class="u-flex u-row-between u-col-center u-w-100s u-m-b-20">
                    <view class="u-flex u-row-left u-col-center" style="width: 90%;">
                        <view class="zixuntitle u-ellipsis-1">{{ option.operation_no }}</view>
<!--                        <view class="zixuntitle u-ellipsis-1 u-m-l-10">{{ option.mobile }}</view>-->
                        <view class="user_img u-m-r-10" @click.stop="copyCode(option.operation_no)">
                            <image style="width: 40rpx;height: 40rpx;border-radius: 50%" src="/static/images/copy.png"></image>
                        </view>
                    </view>
                </view>
                <view class="u-flex tag-list u-p-8 u-m-b-20">
                    <view  class="u-p-l-10 u-p-r-10">{{option.exception_category.join(">")}}</view>
                </view>
                <view class="u-flex u-row-between u-col-center u-w-100s u-m-b-20 color-666">
                    <view class="u-flex u-row-left u-col-center" style="width: 100%;">
                        <view class="user_img u-m-r-10">
                            <image style="width: 40rpx;height: 40rpx;border-radius: 50%" src="/static/images/address.png"></image>
                        </view>
                        <view class="zixuntitle u-ellipsis-1  color-666">{{ option.address }}</view>
                        <view class="user_img u-m-r-10" @click.stop="goLoaction()">
                            <image style="width: 40rpx;height: 40rpx;border-radius: 50%" src="/static/images/daohang.png"></image>
                        </view>
                    </view>
                </view>
                <view class="u-flex u-row-between u-col-center u-w-100s u-m-b-20 color-666">
                    <view class="u-flex u-row-left u-col-center" style="width: 90%;">
                        <view class="user_img u-m-r-10">
                            <image style="width: 40rpx;height: 40rpx;border-radius: 50%" src="/static/images/users.png"></image>
                        </view>
                        <view class="zixuntitle u-ellipsis-1  color-666 u-p-r-10" style="border-right:1rpx solid #ccc">
                            {{ option.user.realname }} {{option.user.mobile}} </view>
                        <view class="zixuntitle u-ellipsis-1 u-m-l-10  color-666">{{option.create_time}}</view>
                        <view class="user_img u-m-r-10" @click.stop="telphone(option.user.mobile)">
                            <image style="width: 40rpx;height: 40rpx;border-radius: 50%" src="/static/images/phone.png"></image>
                        </view>
                    </view>
                </view>
                <view class="u-flex u-row-between u-w-100s status-item" v-if="option.verify_time">
                    <view class="zixuntime u-p-t-10 u-p-b-10">{{option.verify_time}}审核完成</view>
                </view>
            </view>
            <!-- 权限验证 -->
            <u-popup v-model="showTetel" mode="center" border-radius="20" :closeable="true" close-icon-pos="top-right">
                <view class="notice-modal">
                    <view class="notice-title">{{ "是否拨打"+telenum }}</view>
                    <view class="u-flex u-row-around u-w-100s">
                        <button class="u-reset-button back-btn" @tap="showTetel=false">取消</button>
                        <button class="u-reset-button notice-btn" @tap="$tools.callPhone(telenum)">确认</button>

                    </view>
                </view>
            </u-popup>
        </view>
    </view>
</template>

<script>
/**
 * shopro-pages-list-item -列表每一个项

 */

export default {
    name: 'shopro-listItem',
    data() {
        return {
            showTetel:false,
            telenum:'',
        };
    },
    props: {

        option: {
            type: Object,
            default() {
                return {
                };
            }
        },
    },
    methods: {
        goLoaction(){
            console.log("=====",this.option)
            uni.openLocation({
                latitude: Number(this.option.latitude),
                longitude: Number(this.option.longitude),
                name: this. option.address,
                address: this.option.address,
                success: function () {
                    console.log('success');
                }
            });
        },
        jumpto(item) {
            this.$emit('jumpTaskDetail',item.id,item.verify_time?item.verify_time:0);
        },
        telphone(num){
            this.showTetel = true;
            this.telenum = num
        },
        copyCode(code) {
            let that = this;
            uni.setClipboardData({
                data: code,
                success: () => {
                    that.$u.toast('已复制到剪切板');
                }
            });
        },
    }
};
</script>

<style lang="scss" scoped>
.cu-custom {
    width: 100%;
}
.cu-bar {
    width: 100%;
    .content {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex: 1;
        align-items: center;
        pointer-events: auto;
    }
}
.tag-list{
    background: #DDF1FF;
    border-radius: 2px 2px 2px 2px;
    opacity: 1;
    color:#40AFFF
}
.color-666{
    color:#666;
}
.status-item{
    background: #F6F6F6;
    border-radius: 4px 4px 4px 4px;
    color:#999;
}
.zixuntitle,.user_img{
   height: 40rpx
}
// 提示
.notice-modal {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 85vw;
    min-height: 358rpx;
    background: #ffffff;
    padding: 30rpx;
    border-radius: 20rpx;

    .notice-title {
        width: 100%;
        font-size: 30rpx;
        font-weight: bold;
        color: #46351b;
        text-align: center;
    }

    .notice-detail {
        font-size: 24rpx;
        font-weight: 400;
        color: #999999;
        line-height: 36rpx;
        margin-bottom: 50rpx;
    }

    .back-btn {
        width: 45%;
        height: 70rpx;
        line-height: 70rpx;
        background: #f8f8f8;
        box-shadow: 0 7rpx 8rpx 2rpx #ccc;
        border-radius: 35rpx;
        font-size: 26rpx;
        font-weight: 500;
        color: #333;
        margin-bottom: 10rpx;
    }

    .notice-btn {
        width: 45%;
        height: 70rpx;
        line-height: 70rpx;
        font-size: 26rpx;
        font-weight: 500;
        color: #fff;
        border-radius: 35rpx;
        background: #40AFFF;
        box-shadow: #40AFFF;
    }
}
</style>
